import React, { Component } from 'react'
import { View, Image } from 'react-native'
import { Content, CardItem, Thumbnail, Text, Button, Icon, Left, Body, Right } from 'native-base';
import uuid from 'uuid'
import NewTime from './NewTime'
import { ListFresh } from '../../components'


class NewTimeList extends Component {
  render() {
    const { app, user, dispatch } = this.props
    const { newTimeList } = app
    return (
      <View>
        {
          _.isNil(newTimeList) ? <Text>暂无数据</Text> :
          <ListFresh
            key={uuid()}
            dataSource={newTimeList}
            dispatch={dispatch}
            currentUser={user}
            RenderChild={NewTime}
            onReFresh={() => dispatch({ type: 'app/loadNewTimeList' })}
          />
        }
      </View>
    )
  }
}

export default NewTimeList
